package com.fable.ntzw_ga.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.alibaba.excel.util.DateUtils;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.hibernate.annotations.Table;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;


/**
 * 
 *
 * @author Created by gzh 2023-02-19 23:49:21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Entity
@ApiModel(description = "用户实体")
@Table(appliesTo = "sys_user",comment="系统用户表")
@Accessors(chain = true)
public class SysUser implements Serializable  {

    private static final long serialVersionUID = 1L;

    @Id
    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "用户id")
    @Column(name = "id", columnDefinition = "bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户id'")
    private Long id;

    @ApiModelProperty(value = "用户名称")
    @Column(name = "username", columnDefinition = "varchar(32) NOT NULL COMMENT '用户名称'")
    private String username;

    @ApiModelProperty(value = "密码")
    @Column(name = "password", columnDefinition = "varchar(255) NOT NULL COMMENT '密码'")
    private String password;

    @ApiModelProperty(value = "手机号")
    @Column(name = "phone", columnDefinition = "varchar(32) NOT NULL COMMENT '手机号'")
    private String phone;

    @ApiModelProperty(value = "其他")
    @Column(name = "avatar", columnDefinition = "varchar(32) COMMENT '其他'")
    private String avatar;

    @ApiModelProperty(value = "email")
    @Column(name = "email", columnDefinition = "varchar(32) COMMENT 'email'")
    private String email;

    @ApiModelProperty(value = "城市")
    @Column(name = "city", columnDefinition = "varchar(32) COMMENT '城市'")
    private String city;

    @ApiModelProperty(value = "最近登录时间")
    @Column(name = "last_login", columnDefinition = "datetime(0) COMMENT '最近登录时间'")
    private LocalDateTime lastLogin;

    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    @Column(name = "created", columnDefinition = "datetime(0) COMMENT '创建时间'")
    private LocalDateTime created;

    @ApiModelProperty(value = "修改时间")
    @Column(name = "updated", columnDefinition = "datetime(0) COMMENT '修改时间'")
    @DateTimeFormat(pattern = DateUtils.DATE_FORMAT_19)
    @TableField(fill = FieldFill.UPDATE)
    private LocalDateTime updated;

    @ApiModelProperty(value = "状态")
    @Column(name = "status", columnDefinition = "int(5) COMMENT '状态'")
    private Integer status = 1;


}
